<template>
	<AdminLayout activeKey="order-management" :breadcrumbs="['首页','订单与交易管理']" tabTitle="订单与交易管理" :loading="isLoading">
		<view class="page">
			<view class="section-header">
				<text class="section-title">订单管理</text>
				<text class="section-desc">监控有偿任务订单流水和交易状态</text>
			</view>

			<!-- 数据统计卡片 -->
			<view class="stats-grid">
				<view class="stat-card">
					<view class="stat-value">{{ realTimeStats.totalOrders }}</view>
					<view class="stat-label">总订单数</view>
					<view class="stat-desc">数据库所有任务记录</view>
				</view>
				<view class="stat-card">
					<view class="stat-value">¥{{ realTimeStats.totalAmount.toFixed(2) }}</view>
					<view class="stat-label">总交易额</view>
					<view class="stat-desc">所有任务悬赏金额</view>
				</view>
				<view class="stat-card">
					<view class="stat-value">{{ realTimeStats.pendingOrders }}</view>
					<view class="stat-label">待处理订单</view>
					<view class="stat-desc">待接单·待支付·进行中</view>
				</view>
				<view class="stat-card">
					<view class="stat-value">{{ realTimeStats.completedOrders }}</view>
					<view class="stat-label">已完成订单</view>
					<view class="stat-desc">任务成功完成</view>
				</view>
			</view>


			<!-- 筛选工具栏 -->
			<view class="filter-toolbar">
				<input 
					class="search-input" 
					v-model="filters.keyword" 
					placeholder="搜索订单ID、用户或任务" 
					@input="onSearchInput"
					@confirm="onSearchConfirm"
				/>
				<picker mode="selector" :range="statusOptions" @change="onStatusChange">
					<view class="picker-btn">状态：{{ filters.status || '全部' }}</view>
				</picker>
				<picker mode="date" @change="onStartDateChange">
					<view class="picker-btn">开始：{{ filters.startDate || '选择日期' }}</view>
				</picker>
				<picker mode="date" @change="onEndDateChange">
					<view class="picker-btn">结束：{{ filters.endDate || '选择日期' }}</view>
				</picker>
				<button class="filter-btn" @click="refreshData">刷新</button>
			</view>

			<!-- 显示统计信息 -->
			<view class="display-stats">
				<text class="stats-text">数据库总记录：{{ realTimeStats.totalOrders }}条</text>
				<text class="stats-text">当前显示：{{ dataList.length }}条</text>
				<text v-if="pagination.total > 0" class="stats-text">
					第{{ pagination.page }}页，共{{ pagination.totalPages }}页
				</text>
			</view>

			<!-- 内容区域 -->
			<view class="content-area">
				<!-- 订单列表 -->
				<scroll-view scroll-y class="task-list">
					<view v-for="task in dataList" :key="task._id" class="task-item" 
					      :class="{
					        waiting_accept: task.order_status === 'waiting_accept',
					        waiting_payment: task.order_status === 'waiting_payment',
					        in_progress: task.order_status === 'in_progress',
					        completed: task.order_status === 'completed',
					        cancelled: task.order_status === 'cancelled',
					        expired: task.order_status === 'expired',
					        history: isHistoryOrder(task)
					      }">
						<view class="task-header">
							<view class="task-meta">
								<text class="task-type">{{ getTaskTypeFromTitle(task.title) }}</text>
								<text class="task-reward" :class="{ 'paid-reward': task.audit_status !== undefined && task.audit_status !== null }">
									¥{{ task.reward }}
									<text v-if="task.audit_status !== undefined && task.audit_status !== null" class="paid-icon">💰</text>
								</text>
								<text class="task-status" :class="task.order_status">{{ getTaskOrderStatusText(task.order_status) }}</text>
								<text class="payment-status" :class="getPaymentStatus(task).class">
									{{ getPaymentStatus(task).text }}
								</text>
							</view>
							<text class="publish-time">{{ formatTime(task.publish_time) }}</text>
					</view>
					
						<view class="task-content">
							<text class="task-title">{{ task.title }}</text>
							<view class="publisher-info">
							<text>发布者：{{ task.publisher_name }}</text>
								<text v-if="task.complete_time">完成时间：{{ formatTime(task.complete_time) }}</text>
								<text v-if="task.cancel_time">取消时间：{{ formatTime(task.cancel_time) }}</text>
								
								<!-- 接单人信息 -->
								<text v-if="task.participants && task.participants.length > 0">
									接单人：{{ getParticipantName(task.participants[0]) }}
									<text v-if="task.order_status === 'in_progress'" class="in-progress-tag">（进行中）</text>
								</text>
								<text v-else-if="task.order_status === 'waiting_accept'" class="no-participant">
									暂无人接单
								</text>
					</view>
						</view>

						<view class="task-actions">
							<button size="mini" @click="viewTaskDetail(task)">查看详情</button>
							<button v-if="task.order_status === 'waiting_payment'" size="mini" type="primary" @click="requestPayment(task)">催促支付</button>
							<button v-if="task.order_status === 'in_progress'" size="mini" @click="completeTask(task)">完成任务</button>
							<button v-if="task.order_status === 'completed'" size="mini" @click="viewTaskResult(task)">查看结果</button>
							<button v-if="!isHistoryOrder(task)" size="mini" @click="handleTaskDispute(task)">处理纠纷</button>
						</view>
					</view>
				</scroll-view>

				<!-- 分页 -->
				<view class="pagination" v-if="pagination.total > 0">
					<button 
						:disabled="pagination.page <= 1" 
						@click="changePage(pagination.page - 1)"
						size="mini"
					>
						上一页
					</button>
					<text class="page-info">{{ pagination.page }} / {{ pagination.totalPages }}</text>
					<button 
						:disabled="pagination.page >= pagination.totalPages" 
						@click="changePage(pagination.page + 1)"
						size="mini"
					>
						下一页
					</button>
				</view>
			</view>
		</view>

		<!-- 任务详情弹窗 -->
		<view v-if="showDetailModal" class="modal-overlay detail-overlay" @click="closeDetailModal">
			<view class="modal-content detail-modal" @click.stop>
				<view class="modal-header">
					<text class="modal-title">任务详情</text>
					<text class="modal-close" @click="closeDetailModal">×</text>
				</view>
				
				<scroll-view scroll-y class="modal-body detail-body">
					<view class="detail-section">
						<view class="detail-title">{{ currentDetailTask.title }}</view>
						<view class="detail-meta">
							<view class="meta-row">
								<text class="meta-label">任务类型</text>
								<text class="meta-value type-tag">{{ getTaskTypeFromTitle(currentDetailTask.title) }}</text>
							</view>
							<view class="meta-row">
								<text class="meta-label">任务报酬</text>
								<text class="meta-value reward-value">¥{{ currentDetailTask.reward }}</text>
							</view>
							<view class="meta-row">
								<text class="meta-label">订单状态</text>
								<text class="meta-value status-tag" :class="currentDetailTask.order_status">{{ getTaskOrderStatusText(currentDetailTask.order_status) }}</text>
							</view>
							<view class="meta-row">
								<text class="meta-label">支付状态</text>
								<text class="meta-value payment-tag" :class="getPaymentStatus(currentDetailTask).class">{{ getPaymentStatus(currentDetailTask).text }}</text>
							</view>
						</view>
					</view>
					
					<view class="detail-section" v-if="currentDetailTask.description">
						<view class="section-title">任务描述</view>
						<view class="section-content">{{ currentDetailTask.description }}</view>
					</view>
					
					<view class="detail-section">
						<view class="section-title">发布信息</view>
						<view class="publisher-card">
							<view class="publisher-row">
								<text class="publisher-label">发布者</text>
								<text class="publisher-name">{{ currentDetailTask.publisher_name || '未知用户' }}</text>
							</view>
							<view class="publisher-row">
								<text class="publisher-label">发布时间</text>
								<text class="publisher-time">{{ formatTime(currentDetailTask.publish_time) }}</text>
							</view>
						</view>
					</view>
					
					<!-- 接单人信息 - 进行中和已完成状态显示 -->
					<view class="detail-section" v-if="shouldShowAccepterInfo(currentDetailTask)">
						<view class="section-title">接单人信息</view>
						<view class="accepter-card" :class="{ completed: currentDetailTask.order_status === 'completed' }" v-if="getAccepterInfo(currentDetailTask)">
							<view class="accepter-row">
								<text class="accepter-label">接单人</text>
								<text class="accepter-name">{{ getAccepterInfo(currentDetailTask).nickname || '未知用户' }}</text>
							</view>
							<view class="accepter-row" v-if="getAccepterInfo(currentDetailTask).phone">
								<text class="accepter-label">联系电话</text>
								<text class="accepter-phone">{{ getAccepterInfo(currentDetailTask).phone }}</text>
							</view>
							<view class="accepter-row" v-if="getAccepterInfo(currentDetailTask).accept_time">
								<text class="accepter-label">接单时间</text>
								<text class="accepter-time">{{ formatTime(getAccepterInfo(currentDetailTask).accept_time) }}</text>
							</view>
							<view class="accepter-row" v-if="currentDetailTask.order_status === 'completed' && (getAccepterInfo(currentDetailTask).complete_time || currentDetailTask.complete_time)">
								<text class="accepter-label">完成时间</text>
								<text class="accepter-time">{{ formatTime(getAccepterInfo(currentDetailTask).complete_time || currentDetailTask.complete_time) }}</text>
							</view>
							<view class="accepter-row" v-if="getAccepterInfo(currentDetailTask).status">
								<text class="accepter-label">状态</text>
								<text class="accepter-status" :class="getAccepterInfo(currentDetailTask).status">{{ getAccepterStatusText(getAccepterInfo(currentDetailTask).status) }}</text>
							</view>
						</view>
						<view class="no-accepter-tip" v-else>
							<text class="tip-text">暂无接单人信息</text>
						</view>
					</view>
					
					<!-- 支付信息 -->
					<view class="detail-section" v-if="getTaskPaymentRecord(currentDetailTask)">
						<view class="section-title">支付信息</view>
						<view class="payment-card">
							<view class="payment-item">
								<view class="payment-header">
									<text class="payment-id">订单号：{{ getTaskPaymentRecord(currentDetailTask).payment_id }}</text>
									<text class="payment-type">{{ getPaymentTypeText(getTaskPaymentRecord(currentDetailTask).type) }}</text>
								</view>
								<view class="payment-info">
									<text class="payment-amount">¥{{ getTaskPaymentRecord(currentDetailTask).amount }}</text>
									<text class="payment-method">{{ getPaymentMethodText(getTaskPaymentRecord(currentDetailTask).payment_method) }}</text>
								</view>
								<view class="payment-status-info">
									<text class="payment-status-text" :class="getTaskPaymentRecord(currentDetailTask).status">{{ getPaymentStatusText(getTaskPaymentRecord(currentDetailTask).status) }}</text>
									<text class="payment-time" v-if="getTaskPaymentRecord(currentDetailTask).create_time">创建：{{ formatTime(getTaskPaymentRecord(currentDetailTask).create_time) }}</text>
									<text class="payment-time" v-if="getTaskPaymentRecord(currentDetailTask).pay_time">支付：{{ formatTime(getTaskPaymentRecord(currentDetailTask).pay_time) }}</text>
									<text class="payment-time" v-if="getTaskPaymentRecord(currentDetailTask).update_time && getTaskPaymentRecord(currentDetailTask).update_time !== getTaskPaymentRecord(currentDetailTask).create_time">更新：{{ formatTime(getTaskPaymentRecord(currentDetailTask).update_time) }}</text>
								</view>
								<!-- 退款信息 -->
								<view class="refund-info" v-if="getTaskPaymentRecord(currentDetailTask).refund_info && getTaskPaymentRecord(currentDetailTask).status === 'refunded'">
									<text class="refund-amount">退款：¥{{ getTaskPaymentRecord(currentDetailTask).refund_info.refund_amount }}</text>
									<text class="refund-reason" v-if="getTaskPaymentRecord(currentDetailTask).refund_info.refund_reason">原因：{{ getTaskPaymentRecord(currentDetailTask).refund_info.refund_reason }}</text>
								</view>
								<!-- 手续费信息 -->
								<view class="fee-info" v-if="getTaskPaymentRecord(currentDetailTask).platform_fee > 0">
									<text class="platform-fee">平台费：¥{{ getTaskPaymentRecord(currentDetailTask).platform_fee }}</text>
									<text class="actual-amount" v-if="getTaskPaymentRecord(currentDetailTask).actual_amount">实际：¥{{ getTaskPaymentRecord(currentDetailTask).actual_amount }}</text>
								</view>
							</view>
						</view>
					</view>
					
					<!-- 时间节点信息 -->
					<view class="detail-section">
						<view class="section-title">时间节点</view>
						<view class="timeline-card">
							<view class="timeline-item">
								<view class="timeline-dot"></view>
								<view class="timeline-content">
									<text class="timeline-label">发布时间</text>
									<text class="timeline-time">{{ formatTime(currentDetailTask.publish_time) }}</text>
								</view>
							</view>
							<view class="timeline-item" v-if="getAccepterInfo(currentDetailTask) && getAccepterInfo(currentDetailTask).accept_time">
								<view class="timeline-dot active"></view>
								<view class="timeline-content">
									<text class="timeline-label">接单时间</text>
									<text class="timeline-time">{{ formatTime(getAccepterInfo(currentDetailTask).accept_time) }}</text>
								</view>
							</view>
							<view class="timeline-item" v-if="currentDetailTask.complete_time">
								<view class="timeline-dot completed"></view>
								<view class="timeline-content">
									<text class="timeline-label">完成时间</text>
									<text class="timeline-time">{{ formatTime(currentDetailTask.complete_time) }}</text>
								</view>
							</view>
							<view class="timeline-item" v-if="currentDetailTask.cancel_time">
								<view class="timeline-dot cancelled"></view>
								<view class="timeline-content">
									<text class="timeline-label">取消时间</text>
									<text class="timeline-time">{{ formatTime(currentDetailTask.cancel_time) }}</text>
									<text class="timeline-reason" v-if="currentDetailTask.cancel_reason">{{ currentDetailTask.cancel_reason }}</text>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
				
				<view class="modal-footer">
					<button class="modal-btn cancel-btn" @click="closeDetailModal">关闭</button>
				</view>
			</view>
		</view>
	</AdminLayout>
</template>

<script>
import AdminLayout from '@/components/AdminLayout.vue'

export default {
	components: { AdminLayout },
	data() {
		return {
			// 筛选条件
			filters: {
				keyword: '',
				status: '',
				startDate: '',
				endDate: ''
			},
			// 状态选项
			statusOptions: ['全部', '待接单', '进行中', '待支付', '已完成', '已取消', '已过期'],
			// 数据列表
			dataList: [],
			allDataList: [], // 存储所有订单数据，用于本地搜索
			// 分页信息
			pagination: {
				page: 1,
				pageSize: 20,
				total: 0,
				totalPages: 0
			},
			// 统计数据
			statistics: {
				totalOrders: 0,
				totalAmount: 0,
				pendingOrders: 0,
				refundCount: 0
			},
			searchTimer: null, // 搜索防抖定时器
			isLoading: false, // 加载状态
			showDetailModal: false, // 控制详情弹窗显示
			currentDetailTask: {}, // 当前查看详情的任务
			// 官方系统消息配置
			// 保留支付催促功能的系统配置
			systemConfig: {
				payment: {
					senderId: 'payment_admin',
					senderName: '支付服务中心',
					senderAvatar: 'https://mp-f475c10f-31d0-4fb8-a8fa-89f674307ebc.cdn.bspapp.com/system/payment_avatar.png',
					isOfficial: true
				}
			}
		}
	},

	mounted() {
		this.loadStatistics() // 加载数据库真实统计数据
		this.loadData()
	},

	computed: {
		// 实时计算统计数据 - 基于数据库真实数据
		realTimeStats() {
			// 优先使用云函数返回的统计数据（数据库真实统计）
			if (this.statistics.totalOrders > 0) {
				return {
					totalOrders: this.statistics.totalOrders,
					totalAmount: this.statistics.totalAmount,
					pendingOrders: this.statistics.pendingOrders,
					completedOrders: this.statistics.completedOrders || 0
				}
			}

			// 如果云函数统计数据不可用，使用本地数据作为备选
			if (!this.allDataList || this.allDataList.length === 0) {
				return {
					totalOrders: 0,
					totalAmount: 0,
					pendingOrders: 0,
					completedOrders: 0
				}
			}

			const stats = {
				totalOrders: this.allDataList.length,
				totalAmount: 0,
				pendingOrders: 0,
				completedOrders: 0
			}

			this.allDataList.forEach(order => {
				// 计算总交易额（所有订单的悬赏金额）
				stats.totalAmount += parseFloat(order.reward || 0)

				// 计算待处理订单（待接单、待支付、进行中）
				if (['waiting_accept', 'waiting_payment', 'in_progress'].includes(order.order_status)) {
					stats.pendingOrders++
				}

				// 计算已完成订单
				if (order.order_status === 'completed') {
					stats.completedOrders++
				}
			})

			return stats
		},

		// 计算当前显示的订单统计（基于筛选后的数据）
		currentDisplayStats() {
			if (!this.dataList || this.dataList.length === 0) {
				return {
					displayTotal: 0,
					displayAmount: 0
				}
			}

			const stats = {
				displayTotal: this.dataList.length,
				displayAmount: 0
			}

			this.dataList.forEach(order => {
				stats.displayAmount += parseFloat(order.reward || 0)
			})

			return stats
		}
	},

	methods: {
		// 时间格式化
		formatTime(v) {
			if (!v) return '--'
			const d = new Date(v)
			const p = n => String(n).padStart(2, '0')
			return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`
		},


		// 重置筛选条件
		resetFilters() {
			this.filters = {
				keyword: '',
				status: '',
				startDate: '',
				endDate: ''
			}
			this.pagination.page = 1
		},

		// 加载统计数据
		async loadStatistics() {
			try {
				console.log('调用getOrderStatistics云函数获取统计数据')
				const { result } = await uniCloud.callFunction({
					name: 'getOrderStatistics',
					data: {
						isAdmin: true
					}
				})
				
				console.log('统计数据云函数返回:', result)
				
				if (result && result.code === 200) {
					// 更新统计数据，显示数据库真实统计
					this.statistics = {
						totalOrders: result.data.totalTasks || 0,
						totalAmount: parseFloat(result.data.totalAmount || 0),
						pendingOrders: result.data.pendingTasks || 0,
						completedOrders: result.data.completedTasks || 0,
						refundCount: result.data.refundCount || 0
					}
					console.log('数据库真实统计数据:', this.statistics)
					
					// 如果返回消息提示是模拟数据，给用户提示
					if (result.msg && result.msg.includes('模拟数据')) {
						uni.showToast({ 
							title: '使用演示数据', 
							icon: 'none', 
							duration: 1500 
						})
					}
				} else {
					throw new Error(result?.msg || '统计数据获取失败')
				}
			} catch (error) {
				console.error('加载统计数据失败:', error)
				
				// 如果是token相关错误，给出特定提示
				if (error.message && error.message.includes('token')) {
					uni.showToast({ 
						title: '身份验证失败，请重新登录', 
						icon: 'none', 
						duration: 2000 
					})
				} else {
					uni.showToast({ 
						title: '加载统计数据失败', 
						icon: 'none', 
						duration: 1500 
					})
				}
				
				// 使用模拟数据作为备选
				this.statistics = {
					totalOrders: 125,
					totalAmount: 4567.50,
					pendingOrders: 23,
					refundCount: 8
				}
				console.log('使用模拟统计数据:', this.statistics)
			}
		},

		// 加载数据
		async loadData() {
			this.isLoading = true
			let params = {
				isAdmin: true,
				page: this.pagination.page,
				pageSize: this.pagination.pageSize,
				keyword: this.filters.keyword,
				startTime: this.filters.startDate,
				endTime: this.filters.endDate,
				includeAll: true  // 获取全部订单（包括活跃和历史）
			}

			// 处理状态筛选 - 传递订单状态给云函数
					if (this.filters.status && this.filters.status !== '全部') {
				const orderStatus = this.getStatusKey(this.filters.status)
				params.status = orderStatus
				params.includeAll = false  // 有状态筛选时不包含全部
			}

			try {
				console.log('调用getTaskOrders云函数，参数:', params)
				const { result } = await uniCloud.callFunction({
					name: 'getTaskOrders',
					data: params
				})
				
				console.log('云函数返回结果:', result)
				
				if (result && result.code === 200) {
					console.log('=== 云函数数据加载调试 ===')
					console.log('云函数返回结果:', result)
					
					// 处理返回的订单数据，确保数据格式正确
					const rawData = result.data.records || []
					console.log('原始任务数据数量:', rawData.length)
					
					if (rawData.length > 0) {
						console.log('第一个任务样例数据:')
						const sampleTask = rawData[0]
						console.log('  任务ID:', sampleTask._id)
						console.log('  任务标题:', sampleTask.title)
						console.log('  悬赏金额:', sampleTask.reward)
						console.log('  发布者ID:', sampleTask.publisher_id)
						console.log('  支付记录数量:', sampleTask.payment_records ? sampleTask.payment_records.length : 0)
						
						if (sampleTask.payment_records && sampleTask.payment_records.length > 0) {
							console.log('  第一条支付记录:', sampleTask.payment_records[0])
						}
					}
					
					this.allDataList = rawData.map(task => ({
						...task,
						// 确保必要字段存在
						title: task.title || '未命名任务',
						reward: parseFloat(task.reward || 0),
						publisher_name: task.publisher_name || '未知用户',
						publish_time: task.publish_time || Date.now(),
						// 处理参与者信息
						participants: task.participants || [],
						// 处理支付记录
						payment_records: task.payment_records || [],
						// 订单状态（云函数已处理）
						order_status: task.order_status || 'unknown',
						// 添加完成时间和取消时间（如果有的话）
						complete_time: task.update_time && task.status === 'completed' ? task.update_time : null,
						cancel_time: task.update_time && task.status === 'cancelled' ? task.update_time : null
					}))
					
					console.log('处理后的数据数量:', this.allDataList.length)
					if (this.allDataList.length > 0) {
						console.log('处理后第一个任务的支付记录:', this.allDataList[0].payment_records)
					}
					
					this.pagination = {
						page: result.data.page || 1,
						pageSize: result.data.pageSize || 20,
						total: result.data.total || 0,
						totalPages: result.data.totalPages || 0
					}
					// 应用当前筛选和搜索条件
					this.applyFilters()
					
					console.log('成功加载订单数据，总数:', this.allDataList.length)
					console.log('订单数据示例:', this.allDataList[0])
					
					if (this.allDataList.length > 0) {
						// 检查是否是模拟数据
						if (result.msg && result.msg.includes('模拟数据')) {
							uni.showToast({ title: `加载${this.allDataList.length}条演示订单`, icon: 'none', duration: 1500 })
						} else {
							uni.showToast({ title: `加载${this.allDataList.length}条订单`, icon: 'success', duration: 1500 })
						}
					} else {
						uni.showToast({ title: '暂无订单数据', icon: 'none', duration: 1500 })
					}
				} else {
					console.error('云函数返回错误:', result)
					throw new Error(result?.msg || '云函数调用失败')
				}
			} catch (error) {
				console.error('加载订单数据失败:', error)
				
				// 根据不同的错误类型给出不同的提示
				if (error.message && error.message.includes('token')) {
					uni.showToast({ 
						title: '身份验证失败，已切换到演示模式', 
						icon: 'none', 
						duration: 2000 
					})
				} else if (error.message && error.message.includes('网络')) {
					uni.showToast({ 
						title: '网络连接失败，已切换到演示模式', 
						icon: 'none', 
						duration: 2000 
					})
				} else {
					uni.showToast({ 
						title: '云函数调用失败，已切换到演示模式', 
						icon: 'none', 
						duration: 2000 
					})
				}
				
				// 使用模拟数据作为备选
				this.loadMockData()
			} finally {
				this.isLoading = false
			}
		},

		// 加载模拟数据
		loadMockData() {
			this.allDataList = [
					{
						_id: '1',
						title: '代买午餐',
						reward: 50.00,
						status: 'processing',
						order_status: 'in_progress',
						publisher_name: '张三',
						publish_time: Date.now() - 7200000,
					participants: [{
						user_id: 'user1',
						nickname: '小李同学',
						phone: '138****1234',
						accept_time: Date.now() - 6000000, // 2小时前接单
						status: 'active',
						user_info: {
							nickname: '小李同学',
							mobile: '13812341234',
							avatar: 'https://example.com/avatar1.jpg'
						}
					}],
					payment_records: [{ 
						status: 'success',
						amount: 50.00,
						pay_time: Date.now() - 5400000,
						payment_method: '微信支付'
					}]
					},
					{
						_id: '2',
					title: '快递代取',
					reward: 25.00,
						status: 'pending',
					order_status: 'waiting_accept',
					publisher_name: '李四',
					publish_time: Date.now() - 3600000,
					participants: [],
					payment_records: [{
						status: 'success',
						amount: 25.00,
						pay_time: Date.now() - 3000000,
						payment_method: '微信支付'
					}]
				},
				{
					_id: '3',
					title: '代取外卖',
					reward: 15.00,
					status: 'completed',
					order_status: 'completed',
					publisher_name: '王五',
					publish_time: Date.now() - 86400000, // 一天前
					complete_time: Date.now() - 82800000, // 一天前完成
					participants: [{
						user_id: 'user2',
						nickname: '小明',
						phone: '139****5678',
						accept_time: Date.now() - 84000000, // 接单时间
						status: 'completed',
						user_info: {
							nickname: '小明',
							mobile: '13956785678',
							avatar: 'https://example.com/avatar2.jpg'
						}
					}],
					payment_records: [{ 
						status: 'success',
						amount: 15.00,
						pay_time: Date.now() - 82800000,
						payment_method: '支付宝'
					}]
				},
				{
					_id: '4',
					title: '代买课本',
					reward: 80.00,
					status: 'cancelled',
					order_status: 'cancelled',
					publisher_name: '赵六',
					publish_time: Date.now() - 172800000, // 两天前
					cancel_time: Date.now() - 172800000 + 7200000, // 发布后2小时取消
					cancel_reason: '发布者主动取消',
					participants: [],
					payment_records: []
				},
				{
					_id: '5',
					title: '帮忙送文件',
					reward: 30.00,
						status: 'processing',
						order_status: 'in_progress',
					publisher_name: '陈老师',
					publish_time: Date.now() - 10800000, // 3小时前
					participants: [{
						user_id: 'user3',
						nickname: '小王',
						phone: '137****9999',
						accept_time: Date.now() - 9000000, // 2.5小时前接单
						status: 'active',
						user_info: {
							nickname: '小王',
							mobile: '13799999999',
							avatar: 'https://example.com/avatar3.jpg'
						}
					}],
					payment_records: [{
						status: 'success',
						amount: 30.00,
						pay_time: Date.now() - 8400000,
						payment_method: '微信支付'
					}]
				},
				{
					_id: '6',
					title: '代购文具',
					reward: 35.00,
					status: 'pending',
					order_status: 'waiting_payment',
					publisher_name: '小张',
					publish_time: Date.now() - 1800000, // 30分钟前
					participants: [],
					payment_records: []
				},
				{
					_id: '7',
					title: '图书馆占座',
					reward: 8.00,
					status: 'pending', 
					order_status: 'waiting_accept',
					publisher_name: '小李',
					publish_time: Date.now() - 300000, // 5分钟前（最新）
					participants: [],
					payment_records: [{
						status: 'success',
						amount: 8.00,
						pay_time: Date.now() - 180000, // 3分钟前支付
						payment_method: '支付宝'
					}]
				}
			]
			this.pagination = { page: 1, pageSize: 20, total: this.allDataList.length, totalPages: 1 }
			// 应用当前筛选和搜索条件
			this.applyFilters()
		},

		// 筛选事件处理
		onStatusChange(e) {
			const index = Number(e.detail.value)
			this.filters.status = this.statusOptions[index]
			this.applyFilters()
		},

		onStartDateChange(e) {
			this.filters.startDate = e.detail.value
			this.applyFilters()
		},

		onEndDateChange(e) {
			this.filters.endDate = e.detail.value
			this.applyFilters()
		},

		// 搜索输入事件（实时搜索）
		onSearchInput(e) {
			// 清除之前的定时器
			if (this.searchTimer) {
				clearTimeout(this.searchTimer)
			}
			
			// 设置防抖，300ms后执行搜索
			this.searchTimer = setTimeout(() => {
				this.applyFilters()
			}, 300)
		},

		// 搜索确认事件
		onSearchConfirm() {
			// 清除定时器，立即执行搜索
			if (this.searchTimer) {
				clearTimeout(this.searchTimer)
			}
			this.applyFilters()
		},

		// 应用筛选和搜索条件
		applyFilters() {
			let filteredList = [...this.allDataList]

			// 关键词搜索
			if (this.filters.keyword && this.filters.keyword.trim()) {
				const keyword = this.filters.keyword.trim().toLowerCase()
				filteredList = filteredList.filter(task => {
					const title = (task.title || '').toLowerCase()
					const publisherName = (task.publisher_name || '').toLowerCase()
					const taskId = (task._id || '').toLowerCase()
					
					return title.includes(keyword) || 
						   publisherName.includes(keyword) || 
						   taskId.includes(keyword)
				})
			}

			// 状态筛选
			if (this.filters.status && this.filters.status !== '全部') {
				const statusKey = this.getStatusKey(this.filters.status)
				filteredList = filteredList.filter(task => task.order_status === statusKey)
			}

			// 日期筛选
			if (this.filters.startDate || this.filters.endDate) {
				filteredList = filteredList.filter(task => {
					const taskDate = new Date(task.publish_time)
					const startDate = this.filters.startDate ? new Date(this.filters.startDate) : null
					const endDate = this.filters.endDate ? new Date(this.filters.endDate + ' 23:59:59') : null
					
					let passFilter = true
					if (startDate && taskDate < startDate) passFilter = false
					if (endDate && taskDate > endDate) passFilter = false
					
					return passFilter
				})
			}

			// 按优先级排序，待处理订单优先显示
			filteredList.sort((a, b) => {
				const priorityA = this.getOrderPriority(a)
				const priorityB = this.getOrderPriority(b)
				
				// 如果优先级不同，按优先级排序
				if (priorityA !== priorityB) {
					return priorityA - priorityB
				}
				
				// 如果优先级相同，按时间倒序排序（新的在前）
				const timeA = a.publish_time || 0
				const timeB = b.publish_time || 0
				return timeB - timeA
			})

			this.dataList = filteredList
		},

		// 获取订单优先级（用于排序，已支付任务优先显示）
		getOrderPriority(task) {
			const hasPaid = task.audit_status !== undefined && task.audit_status !== null
			
			// 调试信息
			console.log(`任务 ${task.title}: 状态=${task.order_status}, 已支付=${hasPaid}`)
			
			// 根据支付状态和订单状态确定优先级
			if (hasPaid) {
				// 已支付的任务优先级更高
				const paidPriorityMap = {
					'paid_pending': 1,    // 已支付待接单 - 最高优先级
					'waiting_accept': 1,  // 已支付待接单 - 最高优先级
					'in_progress': 2,     // 已支付进行中 - 第二优先级
					'waiting_payment': 3, // 已支付但状态异常
					'completed': 4,       // 已支付已完成
					'cancelled': 5,       // 已支付已取消
					'expired': 6          // 已支付已过期
				}
				const priority = paidPriorityMap[task.order_status] || 7
				console.log(`已支付任务 ${task.title} 优先级: ${priority}`)
				return priority
			} else {
				// 未支付的任务优先级较低
				const unpaidPriorityMap = {
					'waiting_payment': 8,  // 待支付
					'waiting_accept': 9,   // 未支付待接单
					'in_progress': 10,     // 未支付进行中
					'completed': 11,       // 未支付已完成
					'cancelled': 12,       // 未支付已取消
					'expired': 13          // 未支付已过期
				}
				const priority = unpaidPriorityMap[task.order_status] || 14
				console.log(`未支付任务 ${task.title} 优先级: ${priority}`)
				return priority
			}
		},

		// 分页
		changePage(page) {
			this.pagination.page = page
				this.loadData()
		},

		// 刷新数据（重新加载统计和订单数据）
		async refreshData() {
			this.isLoading = true
			try {
				// 先刷新统计数据，再刷新订单数据
				await this.loadStatistics()
				await this.loadData()
				uni.showToast({ title: '数据已刷新', icon: 'success', duration: 1500 })
			} catch (error) {
				console.error('刷新数据失败:', error)
				uni.showToast({ title: '刷新失败', icon: 'none', duration: 1500 })
			} finally {
				this.isLoading = false
			}
		},


	// 任务订单相关方法
	viewTaskDetail(task) {
		// 跳转到订单详情页面
		uni.navigateTo({
			url: `/pages/admin/order-detail/index?id=${task._id}`
		})
	},

		// 判断是否有系统处理信息
		hasSystemProcessing(task) {
			return task.dispute_status || 
				   task.extend_time || 
				   task.admin_note || 
				   (task.update_time && task.update_time !== task.publish_time)
		},

		// 获取纠纷状态文本
		getDisputeStatusText(status) {
			const statusMap = {
				'cancelled_by_admin': '管理员取消',
				'force_completed': '强制完成',
				'time_extended': '时间延长',
				'executor_changed': '执行者变更',
				'admin_mediating': '管理员协调中',
				'suspended': '任务暂停',
				'resolved': '纠纷已解决'
			}
			return statusMap[status] || status
		},

		async requestPayment(task) {
			const confirmed = await this.confirm(`是否向发布者发送支付提醒？\n任务：${task.title}`)
			if (!confirmed) return
			
			try {
				uni.showLoading({ title: '发送中...' })
				
				// 调用云函数发送支付提醒
				const { result } = await uniCloud.callFunction({
					name: 'createChatMessage',
					data: {
						taskId: task._id,
						messageType: 'system',
						senderId: this.systemConfig.payment.senderId,
						receiverId: task.publisher_id,
						content: `您好，您发布的任务"${task.title}"还未完成支付，请及时支付以确保任务正常进行。如有疑问请联系客服。`,
						title: '支付提醒',
						senderInfo: {
							nickname: this.systemConfig.payment.senderName,
							avatar: this.systemConfig.payment.senderAvatar
						},
						receiverInfo: {
							nickname: task.publisher_name,
							avatar: task.publisher_avatar || ''
						},
						extraData: {
							isOfficial: true,
							messageCategory: 'payment_reminder',
							taskInfo: {
								taskId: task._id,
								taskTitle: task.title,
								reward: task.reward
							}
						}
					}
				})
				
				uni.hideLoading()
				
				if (result && result.code === 200) {
					uni.showToast({ title: '支付提醒已发送', icon: 'success' })
				} else {
					throw new Error(result?.msg || '发送失败')
				}
			} catch (error) {
				uni.hideLoading()
				console.error('发送支付提醒失败:', error)
				uni.showToast({ title: '发送失败，请重试', icon: 'none' })
			}
		},

		completeTask(task) {
			uni.showModal({
				title: '完成任务',
				content: `确认将任务标记为已完成？\n任务：${task.title}`,
				confirmText: '确认完成',
				success: (res) => {
					if (res.confirm) {
						uni.showToast({ title: '任务已完成', icon: 'success' })
						this.loadData()
					}
				}
			})
		},

		// 处理纠纷 - 简化版本
		handleTaskDispute(task) {
			// 简单的纠纷处理选项
			const options = [
				'取消任务并退款',
				'强制完成任务', 
				'延长任务时间',
				'介入协调处理'
			]
			
			uni.showActionSheet({
				itemList: options,
				title: `处理纠纷：${task.title}`,
				success: (res) => {
					const selectedIndex = res.tapIndex
					const selectedAction = options[selectedIndex]
					this.executeSimpleDispute(task, selectedAction, selectedIndex)
				},
				fail: () => {
					console.log('用户取消纠纷处理')
				}
			})
		},

		// 简化的纠纷处理执行
		executeSimpleDispute(task, actionName, actionIndex) {
			// 获取操作对应的key
			const actionKeys = [
				'cancel_and_refund',  // 取消任务并退款
				'force_complete',     // 强制完成任务
				'extend_time',        // 延长任务时间
				'admin_mediate'       // 介入协调处理
			]
			
			const actionKey = actionKeys[actionIndex]
			
			// 确认操作
			uni.showModal({
				title: '确认操作',
				content: `确定要${actionName}吗？\n任务：${task.title}`,
				success: (res) => {
					if (res.confirm) {
						this.performDisputeAction(task, actionKey, actionName)
					}
				}
			})
		},

		// 执行纠纷处理操作
		async performDisputeAction(task, actionKey, actionName) {
			try {
				// 显示加载状态
				uni.showLoading({ title: '处理中...' })
				
				// 调用云函数
				const { result } = await uniCloud.callFunction({
					name: 'handleTaskDispute',
					data: {
						taskId: task._id,
						action: actionKey,
						reason: `管理员执行：${actionName}`,
						adminId: 'admin',
						isAdmin: true,
						sendNotification: true, // 启用系统通知发送
						taskInfo: {
							title: task.title,
							reward: task.reward,
							publisher_name: task.publisher_name,
							participants: task.participants || []
						}
					}
				})
				
				uni.hideLoading()
				
				if (result && result.code === 200) {
					// 显示成功结果，包含消息推送状态
					let content = this.getResultMessage(actionKey, task)
					
					if (result.data && result.data.notificationStatus) {
						const notifyStatus = result.data.notificationStatus
						content += `\n\n消息推送状态：`
						if (notifyStatus.publisherSent) {
							content += `\n已通知发布者`
						}
						if (notifyStatus.participantSent) {
							content += `\n已通知执行者`
						}
						if (notifyStatus.failed && notifyStatus.failed.length > 0) {
							content += `\n推送失败：${notifyStatus.failed.join(', ')}`
						}
						
						// 显示聊天消息存储状态
						content += `\n\n消息记录状态：`
						let chatMessagesSaved = 0
						let totalMessages = 0
						
						// 统计聊天消息创建情况
						if (notifyStatus.publisherSent) {
							totalMessages++
							// 这里可以根据实际返回的详细信息来判断
							chatMessagesSaved++
						}
						if (notifyStatus.participantSent) {
							totalMessages++
							chatMessagesSaved++
						}
						
						if (totalMessages > 0) {
							content += `\n已保存 ${chatMessagesSaved}/${totalMessages} 条消息到聊天记录`
						} else {
							content += `\n暂无消息记录`
						}
					}
					
					uni.showModal({
						title: '处理完成',
						content: content,
						showCancel: false,
						success: () => {
							this.loadData() // 重新加载数据
						}
					})
				} else {
					throw new Error(result?.msg || '处理失败')
				}
				
			} catch (error) {
				uni.hideLoading()
				console.error('纠纷处理失败:', error)
				
				// 使用本地模拟处理
				this.mockSimpleDispute(task, actionKey, actionName)
			}
		},

		// 获取结果消息
		getResultMessage(actionKey, task) {
			const messages = {
				'cancel_and_refund': `任务已取消并安排退款\n任务：${task.title}\n退款金额：¥${task.reward}`,
				'force_complete': `任务已强制完成\n任务：${task.title}\n请通知相关用户`,
				'extend_time': `任务时间已延长7天\n任务：${task.title}`,
				'admin_mediate': `已介入协调处理\n任务：${task.title}\n将联系双方沟通`
			}
			return messages[actionKey] || '纠纷处理完成'
		},

		// 本地模拟处理（云函数失败时的备选方案）
		mockSimpleDispute(task, actionKey, actionName) {
			// 更新本地数据
			const orderIndex = this.allDataList.findIndex(t => t._id === task._id)
			if (orderIndex !== -1) {
				switch (actionKey) {
					case 'cancel_and_refund':
						this.allDataList[orderIndex].order_status = 'cancelled'
						this.allDataList[orderIndex].cancel_time = Date.now()
						break
					case 'force_complete':
						this.allDataList[orderIndex].order_status = 'completed'
						this.allDataList[orderIndex].complete_time = Date.now()
						break
					case 'extend_time':
						// 延长时间，状态不变
						break
					case 'admin_mediate':
						// 介入协调，状态不变
						break
				}
				this.applyFilters() // 更新显示
			}
			
			// 显示结果
			uni.showModal({
				title: '处理完成',
				content: this.getResultMessage(actionKey, task) + '\n（演示模式）',
				showCancel: false
			})
			
			uni.showToast({ title: '纠纷处理完成', icon: 'success' })
		},


		// 历史订单相关方法
		viewTaskResult(task) {
			let content = `任务执行结果\n`
			content += `任务标题：${task.title}\n`
			content += `任务悬赏：¥${task.reward}\n`
			content += `最终状态：${this.getTaskOrderStatusText(task.order_status)}\n`
			
			// 发布者信息
			content += `\n发布者信息\n`
			content += `发布者：${task.publisher_name}\n`
			content += `发布时间：${this.formatTime(task.publish_time)}\n`
			
			// 执行结果详情
			if (task.order_status === 'completed') {
				content += `\n完成情况\n`
				content += `完成时间：${this.formatTime(task.complete_time)}\n`
				
				if (task.participants && task.participants.length > 0) {
					const participant = task.participants[0]
					content += `执行者：${participant.nickname || participant.user_info?.nickname || '未知用户'}\n`
					
					// 计算执行时长
					const startTime = participant.accept_time || task.publish_time
					const duration = Math.floor((task.complete_time - startTime) / (1000 * 60 * 60))
					if (duration < 24) {
						content += `执行用时：${duration}小时\n`
					} else {
						const days = Math.floor(duration / 24)
						const hours = duration % 24
						content += `执行用时：${days}天${hours}小时\n`
					}
					
					if (participant.phone) {
						content += `联系方式：${participant.phone}\n`
					}
				}
				
				// 支付信息
				if (task.payment_records && task.payment_records.length > 0) {
					const payment = task.payment_records[0]
					content += `\n支付信息\n`
					content += `支付金额：¥${payment.amount || task.reward}\n`
					content += `支付状态：已支付\n`
					if (payment.pay_time) {
						content += `支付时间：${this.formatTime(payment.pay_time)}\n`
					}
				} else {
					content += `\n支付信息\n支付状态：未支付（需要处理）\n`
				}
				
				content += `\n任务已成功完成`
				
			} else if (task.order_status === 'cancelled') {
				content += `\n取消情况\n`
				content += `取消时间：${this.formatTime(task.cancel_time)}\n`
				
				if (task.cancel_reason) {
					content += `取消原因：${task.cancel_reason}\n`
				}
				
				if (task.participants && task.participants.length > 0) {
					content += `当时执行者：${task.participants[0].nickname || '未知用户'}\n`
				}
				
				// 退款信息
				content += `\n退款信息\n`
				if (task.payment_records && task.payment_records.length > 0) {
					content += `退款金额：¥${task.reward}\n`
					content += `退款状态：已处理\n`
				} else {
					content += `无需退款（未支付）\n`
				}
				
			} else if (task.order_status === 'expired') {
				content += `\n过期情况\n`
				content += `任务已超时过期\n`
				
				const publishDate = new Date(task.publish_time)
				const expireDate = new Date(publishDate.getTime() + 30 * 24 * 60 * 60 * 1000) // 假设30天过期
				content += `过期时间：${this.formatTime(expireDate.getTime())}\n`
				
				if (task.participants && task.participants.length > 0) {
					content += `当时执行者：${task.participants[0].nickname || '未知用户'}\n`
				} else {
					content += `状态：无人接单过期\n`
				}
			}
			
			// 系统处理记录
			if (this.hasSystemProcessing(task)) {
				content += `\n系统处理记录\n`
				
				if (task.dispute_status) {
					content += `纠纷处理：${this.getDisputeStatusText(task.dispute_status)}\n`
				}
				
				if (task.extend_time) {
					content += `时间延长：${this.formatTime(task.extend_time)}\n`
				}
				
				if (task.admin_note) {
					content += `管理员备注：${task.admin_note}\n`
				}
			}
			
			// 任务描述
			if (task.description && task.description.trim()) {
				content += `\n原始需求\n${task.description}\n`
			}
			
			uni.showModal({
				title: '任务执行结果',
				content: content,
				showCancel: false,
				confirmText: '关闭'
			})
		},

		// 判断是否为历史订单
		isHistoryOrder(task) {
			return task.order_status === 'completed' || task.order_status === 'cancelled' || task.order_status === 'expired'
		},

		// 状态文本转换方法
		getStatusKey(text) {
			const keyMap = { 
				'待接单': 'waiting_accept',
				'进行中': 'in_progress',
				'待支付': 'waiting_payment',
				'已完成': 'completed',
				'已取消': 'cancelled',
				'已过期': 'expired'
			}
			return keyMap[text] || text
		},

		getTaskOrderStatusText(status) {
			const statusMap = { 
				waiting_accept: '待接单',
				waiting_payment: '待支付',
				paid_pending: '已支付待接单',
				in_progress: '进行中',
				completed: '已完成',
				cancelled: '已取消',
				expired: '已过期',
				unknown: '未知状态'
			}
			return statusMap[status] || status
		},

		// 从任务标题推断类型
		getTaskTypeFromTitle(title) {
			if (!title) return '其他'
			const titleLower = title.toLowerCase()
			
			if (titleLower.includes('代购') || titleLower.includes('买')) return '代购'
			if (titleLower.includes('出') || titleLower.includes('卖') || titleLower.includes('转让')) return '出物'
			if (titleLower.includes('快递') || titleLower.includes('包裹') || titleLower.includes('代取')) return '快递'
			if (titleLower.includes('外卖') || titleLower.includes('送餐')) return '外卖'
			
			return '其他'
		},

		// 获取参与者姓名
		getParticipantName(participant) {
			if (!participant) return '未知用户'
			
			// 优先使用 nickname，其次使用 user_info.nickname
			return participant.nickname || 
				   (participant.user_info && participant.user_info.nickname) || 
				   '未知用户'
		},


		// 提示输入理由
		promptReason(title) {
			return new Promise((resolve) => {
				uni.showModal({
					title: title,
					editable: true,
					placeholderText: '请输入理由...',
					success: (res) => {
						resolve(res.confirm && res.content ? res.content : null)
					}
				})
			})
		},

		// 确认对话框
		confirm(message) {
			return new Promise((resolve) => {
				uni.showModal({
					title: '确认操作',
					content: message,
					success: (res) => resolve(res.confirm)
				})
			})
		},

		// 关闭详情弹窗
		closeDetailModal() {
			this.showDetailModal = false
			this.currentDetailTask = {}
		},

		// 获取接单人信息
		getAccepterInfo(task) {
			// 只有进行中和已完成状态的任务才显示接单人信息
			if (task.order_status !== 'in_progress' && task.order_status !== 'completed') {
				return null
			}
			
			// 优先使用数据库中的receiver字段（新的数据结构）
			if (task.receiver_id || task.receiver_name) {
				return {
					user_id: task.receiver_id,
					nickname: task.receiver_name,
					avatar: task.receiver_avatar || '',
					phone: task.contact_phone || '', // 使用联系电话字段
					accept_time: task.accept_time,
					complete_time: task.complete_time,
					cancel_time: task.cancel_time,
					status: task.order_status === 'completed' ? 'completed' : 'active'
				}
			}
			
			// 兼容旧的participants数据结构
			if (task.participants && task.participants.length > 0) {
				const accepter = task.participants.find(p => p.status === 'active') || task.participants[0]
				return accepter
			}
			
			return null
		},

		// 获取接单人状态文本
		getAccepterStatusText(status) {
			const statusMap = {
				'active': '正在进行',
				'completed': '已完成任务',
				'cancelled': '已取消',
				'pending': '待确认'
			}
			return statusMap[status] || status || '未知状态'
		},

		// 判断是否应该显示接单人信息
		shouldShowAccepterInfo(task) {
			return task.order_status === 'in_progress' || task.order_status === 'completed'
		},

		// 获取支付状态信息（通过audit_status字段判断）
		getPaymentStatus(task) {
			console.log('=== 获取支付状态调试 ===')
			console.log('任务标题:', task.title)
			console.log('audit_status字段:', task.audit_status)
			
			// 通过audit_status字段判断：有字段就是已支付，没有就是未支付
			const hasPaid = task.audit_status !== undefined && task.audit_status !== null
			console.log('是否已支付:', hasPaid)
			
			if (hasPaid) {
				const result = {
					text: '已支付',
					class: 'paid',
					status: 'success'
				}
				console.log('返回支付状态结果:', result)
				return result
			} else {
				console.log('没有audit_status字段，返回未支付状态')
				return {
					text: '未支付',
					class: 'unpaid',
					status: 'unpaid'
				}
			}
		},

		// 获取支付状态文本（基于真实数据库字段）
		getPaymentStatusText(status) {
			const statusMap = {
				'success': '支付成功',
				'pending': '支付中',
				'failed': '支付失败',
				'cancelled': '支付取消',
				'refunded': '已退款'
			}
			return statusMap[status] || status || '未知状态'
		},

		// 获取支付类型文本
		getPaymentTypeText(type) {
			const typeMap = {
				'task_publish': '任务发布',
				'task_reward': '任务悬赏',
				'recharge': '账户充值',
				'withdraw': '提现',
				'refund': '退款',
				'other': '其他'
			}
			return typeMap[type] || type || '未知类型'
		},

		// 获取支付方式文本
		getPaymentMethodText(method) {
			const methodMap = {
				'wallet': '钱包支付',
				'wechat': '微信支付',
				'alipay': '支付宝',
				'bank_card': '银行卡'
			}
			return methodMap[method] || method || '未知方式'
		},

		// 获取当前任务的支付信息（直接从任务对象获取）
		getTaskPaymentRecord(task) {
			console.log('=== 获取支付信息详细调试 ===')
			console.log('输入任务:', {
				_id: task._id,
				title: task.title,
				reward: task.reward,
				audit_status: task.audit_status,
				payment_id: task.payment_id,
				payment_amount: task.payment_amount,
				payment_method: task.payment_method,
				payment_time: task.payment_time
			})
			
			// 通过audit_status字段判断：有字段就是已支付，没有就是未支付
			const hasPaid = task.audit_status !== undefined && task.audit_status !== null
			
			if (!hasPaid) {
				console.log('❌ 任务未支付（没有audit_status字段）')
				return null
			}
			
			// 构造支付记录对象（基于audit_status判断已支付）
			const paymentRecord = {
				payment_id: task.payment_id || `AUDIT_${task._id}`,
				type: 'task_publish', // 任务发布支付
				amount: task.payment_amount || task.reward,
				status: 'success', // 有audit_status就表示已支付成功
				payment_method: task.payment_method || 'wechat',
				create_time: task.payment_time || task.publish_time,
				pay_time: task.payment_time || task.publish_time,
				update_time: task.payment_time || task.publish_time,
				user_id: task.publisher_id,
				audit_status: task.audit_status,
				task_info: {
					task_id: task._id,
					task_title: task.title,
					task_type: task.type,
					publisher_id: task.publisher_id,
					publisher_name: task.publisher_name,
					receiver_id: task.receiver_id,
					receiver_name: task.receiver_name
				}
			}
			
			console.log('✅ 构造的支付记录:', paymentRecord)
			return paymentRecord
		}
	}
}
</script>

<style scoped>
.page {
	padding: 20rpx;
	min-height: calc(100vh - 140rpx); /* 减去顶部栏和padding的高度 */
	display: flex;
	flex-direction: column;
}

.section-header {
	margin-bottom: 30rpx;
}

.section-title {
	font-size: 36rpx;
	font-weight: 600;
	color: #333;
	display: block;
	margin-bottom: 8rpx;
}

.section-desc {
	font-size: 26rpx;
	color: #666;
	display: block;
}

/* 统计卡片 */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180rpx, 1fr));
	gap: 20rpx;
	margin-bottom: 30rpx;
}

.stat-card {
	background: #fff;
	border-radius: 16rpx;
	padding: 24rpx;
	text-align: center;
	box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
	border: 2rpx solid transparent;
	transition: all 0.3s;
}

.stat-card:hover {
	box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.12);
	border-color: #007aff;
}

.stat-value {
	font-size: 48rpx;
	font-weight: 700;
	color: #007aff;
	margin-bottom: 8rpx;
}

.stat-label {
	font-size: 26rpx;
	color: #666;
}

.stat-desc {
	font-size: 20rpx;
	color: #999;
	margin-top: 4rpx;
	line-height: 1.2;
}


/* 筛选工具栏 */
.filter-toolbar {
	display: flex;
	align-items: center;
	gap: 16rpx;
	margin-bottom: 20rpx;
	flex-wrap: wrap;
}

.search-input {
	flex: 2;
	min-width: 300rpx;
	max-width: 500rpx;
	background: #fff;
	border-radius: 16rpx;
	padding: 20rpx 24rpx;
	border: 2rpx solid #e0e0e0;
	font-size: 30rpx;
	height: 88rpx;
	box-sizing: border-box;
	transition: all 0.3s;
}

.search-input:focus {
	border-color: #007aff;
	box-shadow: 0 0 0 4rpx rgba(0, 122, 255, 0.1);
}

.picker-btn {
	padding: 16rpx 20rpx;
	background: #fff;
	border-radius: 12rpx;
	border: 2rpx solid #f0f0f0;
	font-size: 26rpx;
	color: #333;
	white-space: nowrap;
}

.filter-btn {
	padding: 16rpx 24rpx;
	background: #007aff;
	color: #fff;
	border-radius: 12rpx;
	font-size: 26rpx;
	border: none;
}

.filter-btn.secondary {
	background: #6c757d;
}

/* 显示统计信息 */
.display-stats {
	display: flex;
	align-items: center;
	gap: 20rpx;
	margin-bottom: 20rpx;
	padding: 16rpx 20rpx;
	background: #f8f9fa;
	border-radius: 12rpx;
	border: 1rpx solid #e9ecef;
	flex-wrap: wrap;
}

.stats-text {
	font-size: 24rpx;
	color: #6c757d;
	display: flex;
	align-items: center;
}

.stats-text:first-child {
	font-weight: 600;
	color: #495057;
}

/* 内容区域 */
.content-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0; /* 允许flex子元素收缩 */
}

/* 列表样式 */
.task-list {
	flex: 1;
	overflow-y: auto;
	min-height: 400rpx;
	max-height: calc(100vh - 400rpx);
}

.task-item {
	background: #fff;
	border-radius: 16rpx;
	padding: 24rpx;
	margin-bottom: 16rpx;
	box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
	border: 2rpx solid transparent;
	transition: all 0.3s;
}

.task-item:hover {
	box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.12);
}

.task-item.waiting_accept {
	border-color: #1890ff;
	background: linear-gradient(135deg, #e6f7ff 0%, #fff 100%);
}

.task-item.waiting_payment {
	border-color: #ffd700;
	background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
}

.task-item.in_progress {
	border-color: #52c41a;
	background: linear-gradient(135deg, #f6ffed 0%, #fff 100%);
}

.task-item.completed {
	border-color: #52c41a;
	background: linear-gradient(135deg, #f6ffed 0%, #fff 100%);
}

.task-item.cancelled {
	border-color: #ff4d4f;
	background: linear-gradient(135deg, #fff2f0 0%, #fff 100%);
}

.task-item.expired {
	border-color: #d9d9d9;
	background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
}

.task-item.history {
	opacity: 0.7;
	border-style: dashed;
}

/* 任务项目样式 */
.task-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 16rpx;
}

.task-meta {
	display: flex;
	align-items: center;
	gap: 12rpx;
	flex-wrap: wrap;
}

.task-type {
	padding: 4rpx 12rpx;
	background: #e8f4ff;
	color: #007aff;
	border-radius: 8rpx;
	font-size: 22rpx;
	font-weight: 600;
}

.task-reward {
	font-size: 32rpx;
	font-weight: 700;
	color: #ff6b35;
	display: flex;
	align-items: center;
	gap: 4rpx;
}

.task-reward.paid-reward {
	color: #52c41a;
	font-weight: 800;
}

.paid-icon {
	font-size: 24rpx;
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0% { opacity: 1; }
	50% { opacity: 0.6; }
	100% { opacity: 1; }
}

.task-status, .payment-status {
	padding: 4rpx 12rpx;
	border-radius: 8rpx;
	font-size: 22rpx;
	font-weight: 600;
}

.publish-time {
	font-size: 24rpx;
	color: #999;
}

.task-content {
	margin-bottom: 16rpx;
}

.task-title {
	font-size: 32rpx;
	font-weight: 600;
	color: #333;
	display: block;
	margin-bottom: 8rpx;
	line-height: 1.4;
}

.publisher-info {
	font-size: 24rpx;
	color: #888;
	display: flex;
	flex-direction: column;
	gap: 4rpx;
}

.in-progress-tag {
	color: #52c41a;
	font-weight: 600;
}

.no-participant {
	color: #ff9500;
	font-style: italic;
}

/* 任务状态样式 */
.task-status.waiting_accept { background: #cff4fc; color: #055160; }
.task-status.waiting_payment { background: #fff3cd; color: #856404; }
.task-status.paid_pending { background: #d4edda; color: #155724; font-weight: 600; }
.task-status.in_progress { background: #cce5ff; color: #0066cc; }
.task-status.completed { background: #d4edda; color: #155724; }
.task-status.cancelled { background: #f8d7da; color: #721c24; }
.task-status.expired { background: #e2e3e5; color: #6c757d; }

/* 支付状态样式 */
.payment-status.paid { background: #d4edda; color: #155724; }
.payment-status.unpaid { background: #fff3cd; color: #856404; }


/* 操作按钮样式 */
.task-actions {
	display: flex;
	gap: 12rpx;
	justify-content: flex-end;
	flex-wrap: wrap;
	margin-top: 8rpx;
}

.task-actions button {
	padding: 12rpx 20rpx;
	border-radius: 8rpx;
	font-size: 24rpx;
	border: none;
	transition: all 0.3s;
	min-width: 80rpx;
	font-weight: 500;
	box-shadow: 0 2rpx 4rpx rgba(0,0,0,0.1);
}

.task-actions button:hover {
	transform: translateY(-1rpx);
	box-shadow: 0 4rpx 8rpx rgba(0,0,0,0.15);
}

.task-actions button:active {
	transform: translateY(0);
	box-shadow: 0 2rpx 4rpx rgba(0,0,0,0.1);
}

/* 按钮类型样式 */
button[type="primary"] {
	background: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
	color: #fff;
}

button[type="primary"]:hover {
	background: linear-gradient(135deg, #0066e6 0%, #004bb3 100%);
}

button[type="warn"] {
	background: linear-gradient(135deg, #ff9500 0%, #e6840e 100%);
	color: #fff;
}

button[type="warn"]:hover {
	background: linear-gradient(135deg, #e6840e 0%, #cc730c 100%);
}

button[type="danger"] {
	background: linear-gradient(135deg, #ff3b30 0%, #e6342a 100%);
	color: #fff;
}

button[type="danger"]:hover {
	background: linear-gradient(135deg, #e6342a 0%, #cc2d24 100%);
}

button[size="mini"] {
	padding: 10rpx 18rpx;
	font-size: 22rpx;
	min-width: 76rpx;
}

/* 默认按钮样式 */
.task-actions button:not([type]) {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	color: #495057;
	border: 1rpx solid #dee2e6;
}

.task-actions button:not([type]):hover {
	background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
	color: #343a40;
}

/* 分页样式 */
.pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20rpx;
	margin-top: 20rpx;
	padding: 20rpx;
	background: #fff;
	border-radius: 12rpx;
	box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
}

.page-info {
	font-size: 26rpx;
	color: #666;
	min-width: 120rpx;
	text-align: center;
}

.pagination button {
	padding: 12rpx 20rpx;
	border-radius: 8rpx;
	font-size: 24rpx;
	border: 1rpx solid #dee2e6;
	background: #fff;
	color: #007aff;
	transition: all 0.3s;
}

.pagination button:disabled {
	background: #f8f9fa;
	color: #6c757d;
	cursor: not-allowed;
}

.pagination button:not(:disabled):hover {
	background: #007aff;
	color: #fff;
}

/* 响应式适配 */
@media (max-width: 750rpx) {
	.page {
		padding: 16rpx;
		min-height: calc(100vh - 120rpx);
	}
	
	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16rpx;
	}
	
	.filter-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	
	.search-input {
		margin-bottom: 16rpx;
	}
	
	.task-meta {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.task-actions {
		justify-content: flex-start;
	}
	
	.task-list {
		max-height: calc(100vh - 350rpx);
		min-height: 300rpx;
	}
}

/* 开发者工具适配 */
@media (max-height: 600px) {
	.page {
		min-height: auto;
	}
	
	.data-list {
		max-height: 50vh;
		min-height: 200rpx;
	}
	
	.stats-grid {
		margin-bottom: 20rpx;
	}
	
	.section-header {
		margin-bottom: 20rpx;
	}
}

/* 详情弹窗样式 */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 100;
	animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.detail-overlay {
	backdrop-filter: blur(8rpx);
	background: rgba(0, 0, 0, 0.6);
}

.modal-content {
	background: #fff;
	border-radius: 16rpx;
	width: 90%;
	max-width: 600rpx;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	animation: modalSlideIn 0.3s ease-out;
	box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);
}

.detail-modal {
	max-width: 800rpx;
	animation: detailModalSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	transform-origin: center center;
}

@keyframes modalSlideIn {
	from {
		transform: translateY(-50rpx);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes detailModalSlideIn {
	0% {
		transform: scale(0.8) translateY(-80rpx);
		opacity: 0;
	}
	60% {
		transform: scale(1.02) translateY(-10rpx);
		opacity: 0.8;
	}
	100% {
		transform: scale(1) translateY(0);
		opacity: 1;
	}
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24rpx;
	border-bottom: 2rpx solid #f0f0f0;
}

.modal-title {
	font-size: 32rpx;
	font-weight: 600;
	color: #333;
}

.modal-close {
	font-size: 48rpx;
	color: #999;
	cursor: pointer;
	line-height: 1;
	transition: color 0.3s;
}

.modal-close:hover {
	color: #666;
}

.modal-body {
	flex: 1;
	padding: 0;
	overflow-y: auto;
}

.detail-body {
	padding: 0;
}

.detail-section {
	padding: 32rpx;
	border-bottom: 1rpx solid #f0f0f0;
}

.detail-section:last-child {
	border-bottom: none;
}

.detail-title {
	font-size: 40rpx;
	font-weight: 700;
	color: #333;
	margin-bottom: 24rpx;
	line-height: 1.4;
	word-break: break-word;
}

.detail-meta {
	display: flex;
	flex-direction: column;
	gap: 16rpx;
}

.meta-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16rpx 0;
	border-bottom: 1rpx solid #f8f8f8;
}

.meta-row:last-child {
	border-bottom: none;
}

.meta-label {
	font-size: 28rpx;
	color: #666;
	font-weight: 500;
	min-width: 120rpx;
}

.meta-value {
	font-size: 28rpx;
	font-weight: 600;
	text-align: right;
}

.type-tag {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	padding: 8rpx 16rpx;
	border-radius: 20rpx;
	font-size: 24rpx;
}

.reward-value {
	color: #ff6b35;
	font-size: 32rpx;
	font-weight: 700;
}

.status-tag, .payment-tag {
	padding: 8rpx 16rpx;
	border-radius: 20rpx;
	font-size: 24rpx;
	font-weight: 600;
}

.status-tag.waiting_accept { background: #cff4fc; color: #055160; }
.status-tag.waiting_payment { background: #fff3cd; color: #856404; }
.status-tag.in_progress { background: #cce5ff; color: #0066cc; }
.status-tag.completed { background: #d4edda; color: #155724; }
.status-tag.cancelled { background: #f8d7da; color: #721c24; }

.payment-tag.paid { background: #d4edda; color: #155724; }
.payment-tag.unpaid { background: #fff3cd; color: #856404; }

.section-title {
	font-size: 32rpx;
	font-weight: 600;
	color: #333;
	margin-bottom: 20rpx;
	position: relative;
	padding-left: 16rpx;
}

.section-title::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 6rpx;
	height: 24rpx;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 3rpx;
}

.section-content {
	font-size: 30rpx;
	color: #555;
	line-height: 1.6;
	background: #f8f9fa;
	padding: 24rpx;
	border-radius: 12rpx;
	border-left: 4rpx solid #e9ecef;
	word-break: break-word;
}

.publisher-card, .accepter-card, .payment-card, .timeline-card {
	background: #f8f9fa;
	border-radius: 12rpx;
	padding: 24rpx;
	border-left: 4rpx solid #007aff;
}

.accepter-card {
	border-left-color: #52c41a;
	background: linear-gradient(135deg, #f6ffed 0%, #f8f9fa 100%);
}

.accepter-card.completed {
	border-left-color: #1890ff;
	background: linear-gradient(135deg, #e6f7ff 0%, #f8f9fa 100%);
}

.payment-card {
	border-left-color: #faad14;
}

.timeline-card {
	border-left-color: #52c41a;
}

.publisher-row, .accepter-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16rpx;
}

.publisher-row:last-child, .accepter-row:last-child {
	margin-bottom: 0;
}

.publisher-label, .accepter-label {
	font-size: 26rpx;
	color: #666;
	font-weight: 500;
	min-width: 120rpx;
}

.publisher-name, .publisher-time, .accepter-name, .accepter-phone, .accepter-time {
	font-size: 28rpx;
	color: #333;
	font-weight: 600;
	text-align: right;
}

.accepter-name {
	color: #52c41a;
	font-weight: 700;
}

.accepter-phone {
	color: #1890ff;
	font-family: monospace;
}

.accepter-status {
	font-size: 24rpx;
	font-weight: 600;
	padding: 6rpx 12rpx;
	border-radius: 12rpx;
	text-align: center;
	min-width: 80rpx;
}

.accepter-status.active {
	background: #d4edda;
	color: #155724;
}

.accepter-status.completed {
	background: #cce5ff;
	color: #0066cc;
}

.no-accepter-tip {
	background: #f8f9fa;
	border-radius: 12rpx;
	padding: 32rpx;
	text-align: center;
	border: 2rpx dashed #e0e0e0;
}

.tip-text {
	font-size: 28rpx;
	color: #999;
	font-style: italic;
}

/* 支付信息样式 */
.payment-row {
	margin-bottom: 16rpx;
}

.payment-row:last-child {
	margin-bottom: 0;
}

.payment-item {
	display: flex;
	flex-direction: column;
	gap: 12rpx;
	padding: 20rpx;
	background: #fff;
	border-radius: 12rpx;
	border: 1rpx solid #e9ecef;
	box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.05);
}

.payment-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 8rpx;
	border-bottom: 1rpx solid #f0f0f0;
}

.payment-id {
	font-size: 24rpx;
	color: #666;
	font-family: monospace;
}

.payment-type {
	font-size: 22rpx;
	color: #007aff;
	background: #e6f7ff;
	padding: 4rpx 8rpx;
	border-radius: 8rpx;
	font-weight: 500;
}

.payment-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.payment-amount {
	font-size: 32rpx;
	font-weight: 700;
	color: #52c41a;
}

.payment-method {
	font-size: 26rpx;
	color: #333;
	font-weight: 600;
	background: #f8f9fa;
	padding: 6rpx 12rpx;
	border-radius: 12rpx;
	border: 1rpx solid #e9ecef;
}

.payment-status-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 8rpx;
}

.payment-status-text {
	font-size: 24rpx;
	font-weight: 600;
	padding: 6rpx 12rpx;
	border-radius: 12rpx;
}

.payment-status-text.success {
	background: #d4edda;
	color: #155724;
}

.payment-status-text.pending {
	background: #fff3cd;
	color: #856404;
}

.payment-status-text.failed {
	background: #f8d7da;
	color: #721c24;
}

.payment-status-text.cancelled {
	background: #e2e3e5;
	color: #6c757d;
}

.payment-status-text.refunded {
	background: #fff2f0;
	color: #ff4d4f;
}

.payment-time {
	font-size: 22rpx;
	color: #999;
	flex-shrink: 0;
}

/* 退款信息样式 */
.refund-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12rpx 16rpx;
	background: #fff2f0;
	border-radius: 8rpx;
	border: 1rpx solid #ffccc7;
	margin-top: 12rpx;
}

.refund-amount {
	font-size: 24rpx;
	font-weight: 600;
	color: #ff4d4f;
}

.refund-reason {
	font-size: 22rpx;
	color: #666;
	font-style: italic;
}

/* 手续费信息样式 */
.fee-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8rpx 16rpx;
	background: #f6ffed;
	border-radius: 8rpx;
	border: 1rpx solid #d9f7be;
	margin-top: 8rpx;
}

.platform-fee {
	font-size: 22rpx;
	color: #52c41a;
}

.actual-amount {
	font-size: 24rpx;
	font-weight: 600;
	color: #52c41a;
}

/* 时间线样式 */
.timeline-item {
	display: flex;
	align-items: flex-start;
	margin-bottom: 20rpx;
	position: relative;
}

.timeline-item:last-child {
	margin-bottom: 0;
}

.timeline-item:not(:last-child)::after {
	content: '';
	position: absolute;
	left: 15rpx;
	top: 32rpx;
	bottom: -20rpx;
	width: 2rpx;
	background: #e9ecef;
}

.timeline-dot {
	width: 30rpx;
	height: 30rpx;
	border-radius: 50%;
	background: #e9ecef;
	margin-right: 16rpx;
	flex-shrink: 0;
	margin-top: 4rpx;
}

.timeline-dot.active {
	background: #52c41a;
}

.timeline-dot.completed {
	background: #1890ff;
}

.timeline-dot.cancelled {
	background: #ff4d4f;
}

.timeline-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4rpx;
}

.timeline-label {
	font-size: 26rpx;
	color: #666;
	font-weight: 500;
}

.timeline-time {
	font-size: 28rpx;
	color: #333;
	font-weight: 600;
}

.timeline-reason {
	font-size: 24rpx;
	color: #ff4d4f;
	font-style: italic;
}

.modal-footer {
	display: flex;
	gap: 16rpx;
	padding: 24rpx;
	border-top: 2rpx solid #f0f0f0;
}

.modal-btn {
	flex: 1;
	padding: 16rpx 24rpx;
	border-radius: 8rpx;
	font-size: 28rpx;
	border: none;
	cursor: pointer;
	transition: all 0.3s;
	font-weight: 500;
}

.cancel-btn {
	background: #f5f5f5;
	color: #666;
}

.cancel-btn:hover {
	background: #e8e8e8;
}

/* 响应式适配 */
@media (max-width: 750rpx) {
	.modal-content {
		width: 95%;
		max-height: 85vh;
	}
	
	.detail-modal {
		max-width: 95%;
	}
	
	.detail-section {
		padding: 24rpx;
	}
	
	.detail-title {
		font-size: 36rpx;
	}
	
	.meta-row, .publisher-row, .accepter-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8rpx;
	}
	
	.meta-value, .publisher-name, .publisher-time, .accepter-name, .accepter-phone, .accepter-time {
		text-align: left;
	}
	
	.accepter-status {
		align-self: flex-start;
	}
	
	.payment-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 8rpx;
	}
	
	.payment-info {
		flex-direction: column;
		align-items: flex-start;
		gap: 8rpx;
	}
	
	.payment-status-info {
		flex-direction: column;
		align-items: flex-start;
	}
}
</style>

